<?php
$zagol='Новости';
//require($_SERVER['DOCUMENT_ROOT'].'/inc.php');
require '../header.php'; 
/* Число строк в таблице*/
$vsego2 = mysql_query("SELECT COUNT(*) FROM news WHERE hide_news=0 AND end_date_news >= CURRENT_DATE()");
list($vsego) = mysql_fetch_row($vsego2);
$nastr=$newspage;

$stranic=(int)($vsego/$nastr);

if ($stranic==1) $stranic++;
if ($stranic==0) $stranic=1;
$str=$_GET['str'];




if ($str=='' || $str==False || $str=='0') $str='1';
$nachvivod=($str-1)*$nastr;
$i=1+$nachvivod;
/* Вывод последней новости. */

	
?>


<?php
$newnews = mysql_query ("select * from news WHERE hide_news=0 AND end_date_news >= CURRENT_DATE() order by id_news desc limit $nachvivod,$nastr") or die(mysql_error());
while ($rownewnews = mysql_fetch_array($newnews))
{
echo '<b>'.$i.': <big>'.$rownewnews['subject_news'].'</big></b><br />&nbsp;&nbsp;&nbsp;'.$rownewnews['text_news'];
echo '<div class="date" align="right">',$rownewnews['date_news'],'</div><br />';

$i++;}
?>

<?php
echo 'Cтраницы:<br>';
for ($vs = 1; $vs <= $stranic; $vs++) {
if ($vs==$str)
{
	echo '&nbsp;';
	//echo '&nbsp;&nbsp;&nbsp;';	//if ($vs!=0 && $vs!=1) {echo '<a href=/index.php?page=news&str=',$vs-1,'><small>',пред,'</small></a>&nbsp;';};
	echo '<a href="/news/',$vs,'/"><big><b>',$vs,'</b></big></a>&nbsp;';
	//if ($vs!=$stranic) {echo '<a href=/index.php?page=news&str=',$vs+1,'><small>', след ,'</small></a>&nbsp;';}
	//echo '&nbsp;&nbsp;&nbsp;';
	echo '&nbsp;';
} else {echo '<a href="/news/',$vs,'/">',$vs,'</a>&nbsp;';};}
require '../footer.php';
?>